A crossword is a matrix of squares. The user can adjust the squares that are empty and filled using the mouse. When resized, a crossword automatically adjusts the number of squares in the frame to match. It is possible to extract the words from a crossword with the -getWords method.
There are currently two different versions of the crossword object that need to be unarchived.
*/
+ initialize
{
[Crossword setVersion: VERSION];
return self;
}
/*
The frame will have no line along its left and top edges. A crossword matrix should be shown against an appropriate background that clarifies these edges.
The routine below processes an individual square when extracting words. It exists as a separate function to avoid duplication in the across and down directions.
*/
static BOOL doSquare (inWhite, square, words)
BOOL inWhite;
id square;
id words;
{
BOOL opaque = [square isOpaque];
if (!inWhite && opaque) [words addObject: [[List alloc] init]];
if (opaque) [[words lastObject] addObject: square];